home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / forthcmp.zip / INTS.4TH < prev    next >
Text File  |  1992-03-30  |  843b  |  30 lines

  1. \ Interrupt writing assist functions
  2. \ Copyright (C) 1991 by Thomas Almy.
  3.  
  4. \ Permission is granted to registered users of ForthCMP to sell or distribute
  5. \ computer programs incorporating the compiled contents of this file.
  6.  
  7. \ Code useful for interrupt handler writing
  8. \ Load at start, before program
  9.  
  10.  
  11. 10 HEX
  12. \ New assembler code ( CS override typically needed )
  13. H: JMPF    ( addr -- )  0FF C, 2E C, , ;
  14. H: PUSHF  09C C, ;
  15. H: CALLF ( addr -- )  0FF C, 1E C, , ;
  16.  
  17. CODE set-handler  ( seg offset intnumber -- )
  18.  SI POP AX POP DX POP BX POP 
  19.  DS PUSHSEG BX DS >SEG
  20.  25 # AH MOV  21 INT   ( set interrupt vector call )
  21.  DS POPSEG SI JMPI  END-CODE
  22.  
  23. 1 2 IN/OUT
  24. CODE get-handler ( intnumber -- seg offset )
  25.  35 # AH MOV  21 INT  ( get interrupt vector call )
  26.  BX AX MOV  BX ES <SEG  
  27.  RET  END-CODE
  28.  
  29. 0A = #IF DECIMAL #THEN
  30.